<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateThirdLoginTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('third_logins', function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedInteger('user_id')->index()->comment('关联用户id');
            $table->string('app_id',30)->comment('应用主键:open_id');
            $table->tinyInteger('app_type')->comment('应用类型 1:微信 2:QQ 3:微博');
            $table->string('app_name',30)->comment('应用昵称');
            $table->string('extend')->default('[]')->comment('扩展信息 存入json_string');
            $table->timestamps();

        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('third_login');
    }
}
